<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The SplHeap class</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="splqueue.setiteratormode.html">« SplQueue::setIteratorMode</a></li>
      <li style="float: right;"><a href="splheap.compare.html">SplHeap::compare »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="spl.datastructures.html">数据结构</a></li>
    <li>The SplHeap class</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="class.splheap" class="reference">
 <h1 class="title">The SplHeap class</h1>
 
 
 <div class="partintro"><p class="verinfo">(PHP 5 &gt;= 5.3.0, PHP 7, PHP 8)</p>
 

  <div class="section" id="splheap.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    The SplHeap class provides the main functionalities of a Heap.
   </p>
  </div>

 
  <div class="section" id="splheap.synopsis">
   <h2 class="title">类摘要</h2>
 

   <div class="classsynopsis">
    <div class="ooclass">
     
    </div>

    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">abstract</span>
      <span class="modifier">class</span> <strong class="classname">SplHeap</strong>
     </span>

     <span class="oointerface"><span class="modifier">implements</span> 
       <a href="class.iterator.html" class="interfacename">Iterator</a></span><span class="oointerface">,  <a href="class.countable.html" class="interfacename">Countable</a></span> {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">protected</span> <span class="methodname"><a href="splheap.compare.html" class="methodname">compare</a></span>(<span class="methodparam"><span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span> <code class="parameter">$value1</code></span>, <span class="methodparam"><span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span> <code class="parameter">$value2</code></span>): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="splheap.count.html" class="methodname">count</a></span>(): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="splheap.current.html" class="methodname">current</a></span>(): <span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="splheap.extract.html" class="methodname">extract</a></span>(): <span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="splheap.insert.html" class="methodname">insert</a></span>(<span class="methodparam"><span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span> <code class="parameter">$value</code></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="splheap.iscorrupted.html" class="methodname">isCorrupted</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="splheap.isempty.html" class="methodname">isEmpty</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="splheap.key.html" class="methodname">key</a></span>(): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="splheap.next.html" class="methodname">next</a></span>(): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="splheap.recoverfromcorruption.html" class="methodname">recoverFromCorruption</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="splheap.rewind.html" class="methodname">rewind</a></span>(): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="splheap.top.html" class="methodname">top</a></span>(): <span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="splheap.valid.html" class="methodname">valid</a></span>(): <span class="type">bool</span></div>

   }</div>
 
  </div>
 

 
 </div>
 
 











































































 
<h2>目录</h2><ul class="chunklist chunklist_reference"><li><a href="splheap.compare.html">SplHeap::compare</a> — Compare elements in order to place them correctly in the heap while sifting up</li><li><a href="splheap.count.html">SplHeap::count</a> — Counts the number of elements in the heap</li><li><a href="splheap.current.html">SplHeap::current</a> — Return current node pointed by the iterator</li><li><a href="splheap.extract.html">SplHeap::extract</a> — Extracts a node from top of the heap and sift up</li><li><a href="splheap.insert.html">SplHeap::insert</a> — Inserts an element in the heap by sifting it up</li><li><a href="splheap.iscorrupted.html">SplHeap::isCorrupted</a> — Tells if the heap is in a corrupted state</li><li><a href="splheap.isempty.html">SplHeap::isEmpty</a> — Checks whether the heap is empty</li><li><a href="splheap.key.html">SplHeap::key</a> — Return current node index</li><li><a href="splheap.next.html">SplHeap::next</a> — Move to the next node</li><li><a href="splheap.recoverfromcorruption.html">SplHeap::recoverFromCorruption</a> — Recover from the corrupted state and allow further actions on the heap</li><li><a href="splheap.rewind.html">SplHeap::rewind</a> — Rewind iterator back to the start (no-op)</li><li><a href="splheap.top.html">SplHeap::top</a> — Peeks at the node from the top of the heap</li><li><a href="splheap.valid.html">SplHeap::valid</a> — Check whether the heap contains more nodes</li></ul>
</div>
</div></div></body></html>